using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class tbs_UnevenBillsMap : EntityTypeConfiguration<tbs_UnevenBills>
    {
        public tbs_UnevenBillsMap()
        {
            // Primary Key
            this.HasKey(t => new { t.DATE, t.Document_Type });

            // Properties
            this.Property(t => t.Bill_)
                .HasMaxLength(8);

            this.Property(t => t.Batch)
                .HasMaxLength(10);

            this.Property(t => t.Document_Type)
                .IsRequired()
                .HasMaxLength(4);

            this.Property(t => t.Number)
                .HasMaxLength(8);

            this.Property(t => t.Arabic_name)
                .HasMaxLength(110);

            // Table & Column Mappings
            this.ToTable("tbs_UnevenBills");
            this.Property(t => t.Bill_).HasColumnName("Bill#");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.Batch).HasColumnName("Batch");
            this.Property(t => t.Document_Type).HasColumnName("Document_Type");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Arabic_name).HasColumnName("Arabic_name");
        }
    }
}
